package com.ximu.user.controller;

import com.ximu.user.service.AlipayService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;


@RestController
public class PayController {
    @Autowired
    @Qualifier("alipayService")
    private AlipayService alipayService;

    @RequestMapping("/pay")
    @ApiOperation(value = "手机支付")
    public String payController(@ApiParam("订单编号")String id, @ApiParam("订单名称")String name, @ApiParam("订单价格")String amount ) throws Exception {
        Integer pay=Integer.valueOf(amount);
        String pays = alipayService.appPagePay(id, pay, name);
        return pays;
    }

}
